//创建最近阅读的控制器JS
msqbapp.controller('zuijinyueduController',function ($scope,msqbService) {
    $scope.userId = 0;
    $scope.classifyId = 0;
    //最近阅读的初始化函数
    $scope.zuijinyueduInit = function () {
        var userId = window.location.search.split('=')[1];
        var classifyId = window.location.search.split('=')[1];
        var arr = window.location.search.split('&');
        for (var i = 0;i<arr.length;i++){
            var strarr = arr[i].split('=');
            if(strarr[0]=='?userId'){
                $scope.userId = strarr[1];
            }
            if(strarr[0]=='classifyId'){
                $scope.classifyId = strarr[1];
            }
        }
    msqbService.getRecentTopic($scope.userId,$scope.classifyId).success(function (resp) {
        if(resp.length>0){
            $scope.recentTopicList = resp;
        };
    });
    };
    //打开具体某一个题目的函数
    $scope.getTopicItem=function (userId,topicId) {
        window.open("topicitem.html?userId="+userId+"&topicId="+topicId);
    }

});
